<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //获取用户的输入
        // prompt("字符串",默认值);
        // var username=prompt("请输入你的姓名","小旺旺");//将输入的数据保存到变量username中去
        // console.log(username);

        var num=prompt("请输入一个数字:");//10
        console.log(num);
        console.log(typeof num);//string
        console.log(num+3);//拼接

        //将字符串转换为数值，语法:Number(字符串)
        num=Number(num);//将字符串10转换为数值类型的10
        console.log(num+3);
       

       

    </script>
</head>
<body>
    
</body>
</html>